package com.xiaoshuidi.cloud.module.bpm.convert;

import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

import java.time.LocalDateTime;

public class MyLocalDateTimeConverter implements Converter<LocalDateTime> {
    @Override
    public WriteCellData<?> convertToExcelData(LocalDateTime value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        String format = DateUtil.format(value, "yyyy-MM-dd HH:mm:ss");
        return new WriteCellData<>(format);
    }
}
